const mysql = require("mysql");

var pool = mysql.createPool({
    host: 'localhost',
    user: 'root',
    password: '',
    port: 3306,
    database: 'jjw',
    multipleStatements: true
});

function query(sql) {
    return new Promise((resolve, reject) => {
        pool.query(sql, (err, data) => {
            if (err) reject(err);
            resolve(data);
        })
    })
}


module.exports = query;